package cc.idoone.spring_boot_hello.mybatis.h2.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @auther hemj
 * @since 2017/9/24
 */
@ApiModel(value = "User", description = "用户实体")
public class User {

	@ApiModelProperty(value = "用户ID", notes = "用户ID 由系统生成")
	private Integer id;

	@ApiModelProperty(value = "用户名称", required = true)
	private String name;

	@ApiModelProperty(value = "用户年龄", required = true, notes = "用户年龄必须为正数")
	private Integer age;

	public User() {
	}

	public User(String name, Integer age) {
		this.name = name;
		this.age = age;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	@Override
	public String toString() {
		final StringBuilder sb = new StringBuilder("User{");
		sb.append("id=").append(id);
		sb.append(", name='").append(name).append('\'');
		sb.append(", age=").append(age);
		sb.append('}');
		return sb.toString();
	}
}
